<template>
  <div class="not-found">
    <div class="content">
      <h1 class="error-code">404</h1>
      <div class="error-desc">抱歉，您访问的页面不存在</div>
      <div class="error-info">
        请检查您输入的网址是否正确，或者点击下方按钮返回首页
      </div>
      <el-button type="primary" @click="goHome" class="home-button"
        >返回首页</el-button
      >
    </div>
  </div>
</template>

<script setup lang="ts">
import { useRouter } from "vue-router"

const router = useRouter()

const goHome = () => {
  router.push("/home")
}
</script>

<style scoped>
.not-found {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f5f7fa;
  min-height: 500px;
}

.content {
  text-align: center;
  padding: 40px;
}

.error-code {
  font-size: 120px;
  color: #409eff;
  margin: 0;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
  animation: bounce 2s ease infinite;
}

.error-desc {
  font-size: 24px;
  color: #303133;
  margin: 20px 0;
  font-weight: 500;
}

.error-info {
  font-size: 16px;
  color: #606266;
  margin-bottom: 30px;
}

.home-button {
  padding: 12px 30px;
  font-size: 16px;
  transition: all 0.3s ease;
}

.home-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(64, 158, 255, 0.2);
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}
</style>
`
